package com.example.goods.repository;

import com.example.goods.bean.Cart;
import org.springframework.data.jpa.repository.JpaRepository;


/**
 * Created by IntelliJ IDEA.
 *
 * @author ouyangzhixiang
 * @date 2018/7/4
 */
public interface CartRepository extends JpaRepository<Cart,Integer> {
    /**
     * 查询用户Id和对应的商品Id
     * @param userId
     * @param productId
     * @return
     */
    Cart findByUserIdAndProductId(Integer userId,String productId);

    /**
     * 查询商品Id
     * @param productId
     * @return
     */
    Cart findByProductId(String productId);

}
